function GM:OnSpawnMenuOpen()
	if MENU == nil or not MENU:IsValid() then
		vgui.Create("bs_menu")
	else
		MENU:SetVisible(true)
	gui.EnableScreenClicker(true)
	RestoreCursorPosition()
	
end

function GM:OnSpawnMenuClose()
	if MENU and MENU:IsValid() and MENU:IsVisible() then
		MENU:SetVisible(false)
	end
	RememberCursorPosition()
	gui.EnableScreenClicker(false)
end
local PANEL = {}

function PANEL:Init()
	MENU = self
	self:SetTitle("Beyond Space Menu")
	self.ContentPanel = vgui.Create("DPropertySheet", self)
	self:ShowCloseButton(false)
	self.ContentPanel:AddSheet("Prop Spawn", vgui.Create("bs_propspawn"),self), "gui/silkicons/brick_add",true,true)
	
end

function PANEL:Close()
	menuup = false
 	self:Remove()
end

function PANEL:PerformLayout()
	self:SetSize(ScrW() - 50, ScrH() - 50)
	self:SetPos(50,50)
	self.ContentPanel:StretchToParent(4,26,4,4)
	
	DFrame.PerformLayout(self)
end

vgui.Register("bs_menu",PANEL, "DFrame")

